import React, { PropTypes } from 'react';
import { connect } from 'dva';
import { Link } from 'dva/router';
import { Menu, Breadcrumb, Icon, Badge, Button} from 'antd';
const SubMenu = Menu.SubMenu;

import LeftMenu from './Menu';
import './less/common.less';
import './less/index.less';
import './css/font-awesome.less';

class Content extends React.Component {
    constructor(props){
        super(props);
        this.state={
            collapse:false,
            size:false
        }
    }
    onCollapseChange() {
      this.setState({
        collapse: !this.state.collapse,
      })
    }
    componentDidMount(){
      let _self = this;
      window.onresize=function(){
            _self.setState({
                size:!_self.state.size
            })
      }
    }
    render(){
      return (
        <div className="ant-layout-aside">
          <aside className="ant-layout-sider">
            <div className="ant-layout-logo">
                <img src="https://zos.alipayobjects.com/rmsportal/iXsgowFDTJtGpZM.png"/>
            </div>
            <LeftMenu />
          </aside>
          <div className="ant-layout-main">
            <div className="ant-layout-header">
                <div className="left">
                    <Icon type="edit" />
                    <span>课程助手<span className="fa fa-pull-left"></span></span>
                </div>
                <div className="right">
                  <Link to="/app/news">
                    <Badge count={5}>
                      <Icon type="notification" />
                    </Badge>
                  </Link>

                  <Icon type="export" />
                </div>
            </div>
            <div className="headDate">
                <div className="dataPanel">
                    <div className="date">11月28日</div>
                    <div className="week">星期一</div>
                </div>
            </div>
            <div className="ant-layout-container">
                <div className="ant-layout-content" style={{ height: document.body.clientHeight-262 }}>
                    {this.props.children}
                </div>
            </div>
          </div>
        </div>
      )
    }
}

export default Content;
